package com.sakana.biginteger;

import java.math.BigInteger;

public class demo2 {
    public static void main(String[] args) {
        //1.创建两个biginteger对象
        BigInteger bd1=BigInteger.valueOf(10);
        BigInteger bd2=BigInteger.valueOf(10);

        //2.加法
        BigInteger bd3=bd1.add(bd2);
        System.out.println(bd3);

        //3.除法，获取商和余数
        BigInteger[] arr= bd1.divideAndRemainder(bd2);
        System.out.println(arr[0]);
        System.out.println(arr[1]);

        //4.比较是否相同
        boolean result=bd1.equals(bd2);
        System.out.println(result);

        //5.次幂
        BigInteger bd4=bd1.pow(2);
        System.out.println(bd4);

        //6.max
        BigInteger bd6=BigInteger.valueOf(200);
        double v=bd6.doubleValue();
        System.out.println(v);
    }
}
